﻿@model IEnumerable<Scrumrun.Models.UserStory>

@{
    ViewBag.Title = "Sprint";
}



<div class="container">

    <h3>@ViewBag.ProjectName</h3> 

    <div class="row mainwrapper">
        <div class="span2">

            <ul class="unstyled">
                <li>
                    @*@Html.ActionLink("Project", "Details", "Project", new { id = ViewBag.CurrentProject }, new { @class="btn btn-warning"} )*@
                    <a class="btn btn-warning" href="@Url.Action("Details", "Project", new { id = ViewBag.CurrentProject })">
                        <i class="icon-th-large icon-white"></i> Project
                    </a>
                </li>
                <li>&nbsp;</li>
                <li>
                    @Html.ActionLink("View Backlog", "index", "Backlog", new { ProjectId = ViewBag.CurrentProject }, new { @class = "btn btn-info" })
                </li>
                <li>&nbsp;</li>
                <li>
                    @Html.ActionLink("View Board", "sprintboard", "Sprint", new { ProjectId = ViewBag.CurrentProject }, new { @class = "btn btn-primary" })
                </li>
           </ul>

            <br />
            <h5>Members</h5>

            @Html.Action("UserList", "Sprint")
            
            <br />

        <ul class="unstyled">
            <li>
                @*@Html.ActionLink("Manage Sprint", "Index", "Iteration", new { ProjectId = ViewBag.CurrentProject }, new { @class="btn"} )*@
                <a class="btn" href="@Url.Action("EditSprints", "Project", new { ProjectId = ViewBag.CurrentProject })">
                    <i class="icon-wrench"></i> Manage Sprint
                </a>
            </li>
        </ul>

        <div class="alert alert-info"><button type="button" class="close" data-dismiss="alert">&times;</button>
            You can drag userstories and drop them on a member in the members' list to assign it to that member.
        </div>

        </div>
        <!--sidebar-->

        <div class="span10">
            <div class="contentwrap">
            <h4>@ViewBag.SprintName</h4>

                <table id="sprintList" class="srtable">

                    <tr>
                        <th></th>
                        <th>
                            @Html.DisplayNameFor(model => model.Title)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Effort)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.ItemStatus.Status)
                        </th>
                        <th>Assigned to
                         @*@Html.DisplayNameFor(model => model.UserId)*@
                        </th>
                    </tr>

                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr data-id="@item.Id">
                                <td>
                                   <i class="icon-move"></i>
                                    <a class="editForm" href="@Url.Action("Edit", "Sprint", new { id = item.Id })">
                                        <i class="icon-pencil"></i>
                                    </a>
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.Title)
                                </td>

                                <td>
                                    @Html.DisplayFor(modelItem => item.Effort)
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.ItemStatus.Status)
                                </td>

                                <td>
                                    @Html.DisplayFor(modelItem => item.UserProfile.UserName)
                                </td>

                            </tr>
                        }
                    </tbody>

                </table>

                <!--tasks-->
            </div>
        </div>
    </div>
</div>



<input id="ProjectId" name="ProjectId" type="hidden" value="@ViewBag.CurrentProject" />



@*    <h2>Index</h2>

    <p>
        @Html.ActionLink("Create New", "Create")
    </p>
    <table>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.BackLogPriority)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Effort)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.UserId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Project.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ItemStatus.Status)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Sprint.Name)
            </th>
            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Title)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.BackLogPriority)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Effort)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.UserId)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Project.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ItemStatus.Status)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Sprint.Name)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
            @Html.ActionLink("Details", "Details", new { id = item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.Id })
                </td>
            </tr>
        }

    </table>*@
